package org.example.product.controller;

import org.example.product.api.model.ProductModel;
import org.example.product.api.service.ProductRemoteService;
import org.example.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProductController implements ProductRemoteService {

    @Autowired
    private ProductService productService;

    @Override
    public ResponseEntity<List<ProductModel>> list() {
//        int i = 1/0;
        return ResponseEntity.ok(productService.selectList(null));
    }
}
